// 引入公共utils
import axios from '@/utils/utils'

// 单个暴露用export,其他地方用解构对象接
// 超简写(登录)
export let login = params => axios.post('/users/checkLogin', params)
// 需要return,另一边才能接结果

// 添加帐号
export let adduser = params => axios.post('/users/add', params)

// 获取帐号列表,get方式是?后面传参,在axios里,params外面必须加{}
export let userlist = params => axios.get('/users/list', { params })

// 删除帐号
export let deluser = params => axios.get('/users/del', { params })

// 批量删除帐号
export let delalluser = params => axios.get('/users/batchdel', { params })

// 修改账号
export let changelistname = params => axios.post('/users/edit', params)

// 验证密码是否正确
export let checkpwd = params => axios.get('/users/checkoldpwd', { params })

// 修改密码
export let changeoldpwd = params => axios.post('/users/editpwd', params)

// 获取账号（个人中心）信息
export let getinfo = params => axios.get('/users/accountinfo', { params })

// 验证token是否过期
export let checktoken = params => axios.get('/users/checktoken', { params })
